package Dao;

import Model.User;
import Model.UserQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

import utils.pages.Page;
/**
 * 用户信息管理
 */
public interface UserDao {
    List<User> getList(UserQuery query);
    int countList(UserQuery query);
    int add(User user);
    int delete(User user);
    int updateState(User user);
    int update(User user);
    List<User> getName(User user);

    int updateuserById(User user);
//    int insertuser(User user);
    User getuser(@Param("user_id") Integer id);
    List<User> getusers(@Param("userSearch") User userSearch);
    int deluser(@Param("user_id") Integer id);

    /**
     * 新增派工订单-默认机构信息显示
     * @return
     */
    String findSettleCodebyUserNumber(String UserNumber);

    User findUserByName (String user_number);

    /**
     * 护工页面-机构权限
     * @return
     */
    String findRoleIDbyUserNumber(String UserNumber);

    /**
     * 用户登陆：通user_number和password查找
     * @param user_number
     * @param password
     * @return
     */
    User findUser (@Param("user_number") String user_number,
                   @Param("password") String password);
    User findUserById(Integer id);

    /**
     * 用户数：查询区管理员总数
     * @return
     */
    Integer selectUserListCount(@Param("uName")String uName,@Param("uNumber")String uNumber,@Param("uRole")String uRole);

    Integer selectUserListCount2(@Param("uName")String uName,@Param("uNumber")String uNumber,@Param("uRole")String uRole);

    Integer selectUserListCount3(@Param("uName")String uName,@Param("uNumber")String uNumber,@Param("uRole")String uRole);

    /**
     * 条件查询区管理员
     * @return
     */
    List<User> findUserListByUserName(@Param("uName")String uName,@Param("uNumber")String uNumber, @Param("uRole")String uRole,
                                      @Param("start")Integer start, @Param("rows")Integer rows);

    List<User> findUserListByUserName2(@Param("uName")String uName,@Param("uNumber")String uNumber, @Param("uRole")String uRole,
                                       @Param("start")Integer start, @Param("rows")Integer rows);

    List<User> findUserListByUserName3(@Param("uName")String uName,@Param("uNumber")String uNumber, @Param("uRole")String uRole,
                                       @Param("start")Integer start, @Param("rows")Integer rows);

    /**
     * 通过id获取用户信息
     * @param id
     * @return
     */
    User getUserById(Integer id);
    User getUserByName(String name);
    User getUserBySex(String sex);
    List<User> selectByUserId(int user_id);
    List<User> selectByUserName(String user_name);
    List<User> selectByUserSex(String user_sex);
    /**
     * 更新用户信息
     * @param user
     * @return
     */
    int updateUser(User user);

    Page<User> Show_All_User();
}
